<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用戶信息查询</title>
<%@include file="../head.jsp" %>
<link href="css/xml.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#jsonResult{
	background-color: #FFFFFF;
	width: 800px;
	height: 400px;
}
</style>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript">
function doSubmit(){
	var form = $("#tradeAccoForm");
	ajaxSubmit(form);
}

	function ajaxSubmit(form){
		 var formParam = form.serialize();//序列化表格内容为字符串
		$.ajax({
		     type: 'POST',
		     url: "query/tyebaccoinfo.do" ,
		    data: formParam ,
		    success: function(data){
				var isJson = $("input[name='isJson']:checked").val();
				if (isJson == 0){
			    	var s = data.replace(/[^=]/g, "");
			    	$("#jsonResult").attr("rows",s.length+1);
		    	}
		    	$("#jsonResult").val($.trim(data));
		    } ,
		    error:function(){
		    	alert("访问服务过程错误！")
		    },
		    dataType: "text"
		}); 
	}
</script>
</head>
<body>
	<form id="tradeAccoForm" action="<%=request.getContextPath() %>/query/tyebaccoinfo.do" method="post">
		<table>
			<tr><td width="100px">交易账号</td><td><input name="vcTradeacco" value="00999000000010003"/></td></tr>
			<tr><td width="100px">是否响应JSON</td><td><input name="isJson" type="radio" value="1" />是<input name="isJson" type="radio" value="0" checked="checked"/>否<td></tr>
			<tr><td></td><td><input type="button" value="提交" onclick="doSubmit()"/><td></tr>
		</table>
	</form>
	
	<div>
		<textarea cols="2" rows="10" id="jsonResult"></textarea>
	</div>
</body>
</html>